package com.edu.jiangzhi.domain;

/**
 * @author duweiping
 *
 */
public abstract class Animal {
    protected String name;
    protected Integer weight;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    /**
     * 重写hashcode 和 equals 方法，因为Animal对象需要作为工厂key。
     * @return
     */
    @Override
    public int hashCode() {
        return super.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
